Repository navigation
fix(ui): a lookup's group headers and filter options read the target's nameField, and the empty group is translated - #35140
Conversation
…et nameField; localize the empty group Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T07:31ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review (#35053) · 2026-11-18T07:32ZL1: REWORK (one must-fix, the This is the first L1 on this PR. I read the full diff against the merge-base The fix, read against the card.
Shape and scope.
Changeset.
Tests and evidence.
CI at this head, read from check-runs (58): 45 success, 13 skipped, none failed, none in progress. Must-fix
Should-fixNone. Notes
|
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract review brief handed to the isolated reviewer (TIER_DEFAULT, declaration face), posted beside its record: Contract review brief — PR #35140 @
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Inputs: card #35053 (body and all 5 comments: triage 6965529303, claim 6970395023, os-dev-report 6971765036, claim amendment 6972188277, addendum 6972246390), PR #35140 (body, the L1 REWORK 6972149286, the final-head note 6972122145, and the brief 6972264641), the full diff against merge-base ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 delta · 2026-11-18T07:58ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review, delta for REWORK 6972149286 (#35053) · 2026-11-18T07:59ZL1: ACCEPT M1, closed.
No code changed, so everything else in 6972149286 stands for this head. CI at this head, from check-runs: 47 success, 15 skipped, none failed or in progress. Must-fixNone. Should-fixNone. NotesNone. |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T08:01Z
Open findings: contract-record nits N1 (changeset does not name State: ready + auto-merge armed by area o1-B (lease Dev-effort: medium · Rounds: 2 |
Requested by Warren · project thread
Fixes #35053
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
displayField时改用目标对象声明的nameField命名,不再显示原始记录 id;空值分组的标题改用网格已有的「空」文案(grid.empty),随语言翻译。displayField的默认值写明是「被引用对象的 name/title」,单元格与记录页头早已这样做;这三处却只猜name/label/title,目标对象以自动编号等字段为标题时(如DEAL-2026-0001),中文用户看到的是一串 id 和英文的(empty)。(empty)变为Empty,位置不变。回滚即 revert 本 PR。ui/packages/plugin-grid/src/useServerGrouping.ts(标题读取处并行读目标定义)、ui/packages/components/src/custom/filter-builder.tsx(LookupValuePicker改为存记录、渲染时算标签)、ui/packages/core/src/utils/record-title.ts(新增referencedRecordTitle,从getRecordDisplayName拆出无兜底的一段)。pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/lookupGroupNameField-35053.test.tsx packages/components/src/__tests__/filter-builder-lookup-namefield-35053.test.tsx,预期 10 个用例全绿(含 zh-CN 空分组显示「空」)。What changes
@object-ui/coreaddsreferencedRecordTitle(targetDef, record, displayField?): the lookup's owndisplayField, then the target object'sgetRecordDisplayNameladder (declarednameFieldfirst, ADR-0079), stopping short of theRecord #ID/Untitledfloor and answeringundefinedthere, so each caller keeps its own face for an unnamed record.getRecordDisplayNameis split into the rungs above the floor (recordTitleAboveFloor, module-private) plus the floor, so the two cannot drift; its behaviour is unchanged.useServerGroupHeaders): the label read now reads the target's definition in parallel with the record read (readLookupTargetDef) and names each id throughreferencedRecordTitle. Before:displayField, elsename ?? label ?? title, else the raw id.useObjectGridGrouping'sgroupValueFormatter): a lookup grouping field's expanded record is named throughreferencedRecordTitlewith the target definition (useLookupTargetDefs, enabled only on the client path) and the field'sdisplayField. Before: thedisplayFieldwas ignored and thename ?? label ?? title ...guess ran.buildSegmentLabel's object arm, used by the publisheduseGroupedDatawith no formatter, now runs the same resolver with no target definition (record-only ladder) instead of its own key list.LookupValuePicker):displayFieldno longer defaults to"name"; the target definition is read through@object-ui/react'suseSettledSchema(one read per picker mount), and options plus the chosen value's chip are labelled at render throughreferencedRecordTitle, so a definition that lands after the search still names them. Options and selections stay keyed and written by id.(empty)is replaced by the grid's existing empty-value keygrid.empty(translated in all twelve packs:Empty,空, ...), read insideuseGroupedDataInOptionOrderthroughuseGridTranslation. No new locale key. The empty group keeps its place in label order by its KEY, not its heading (compareGroupLabels): first ascending, last descending, as the untranslated heading always sorted.Tests
ui/packages/plugin-grid/src/__tests__/lookupGroupNameField-35053.test.tsx: per producer (server-grouped, client-grouped) a target withnameField: 'deal_number'and no name/label/title heads its groups with the deal numbers; CONTROL that an explicitdisplayFieldstill wins; two records sharing one title stay two groups; zh-CN empty group reads空and keeps its place.ui/packages/components/src/__tests__/filter-builder-lookup-namefield-35053.test.tsx: options read the deal numbers and the picked value written is the id; the chosen value's chip reads the deal number; CONTROL that an explicitdisplayFieldwins.record-title.test.ts: four pins onreferencedRecordTitle(nameField, displayField wins, undefined wheregetRecordDisplayNamefloors, record-only ladder without a definition).'(empty)'to'Empty'ingroupSelectOptionOrder-11809,groupDateHeading-13234andserverGroupingFieldSwitch-11574(the ascending order controls there stay green, which is the order-preservation evidence).Acceptance notes
objectFields, which carriesreferenceanddisplayField, not the target'snameField); the lookup cell's target-schema cache is private to@object-ui/fields, which@object-ui/componentscannot import (cycle). Cheapest correct path taken:dataSource.getObjectSchema(target), one per target per header load / per change of the client grouping's target list / per picker mount. The ObjectStack adapter serves repeat reads from its metadata cache, and the lookup cells on the same screen already read the same targets, so in the Console this is normally zero extra network requests.useGroupedDatawith no formatter now names an expanded record byreferencedRecordTitle's record-only ladder:name,full_name,fullName,display_name,displayName,title,subject,label, then the*_name/*_titleaffix scan. The old list putlabelbeforetitleand had nosubjector affix leg.Emptywhere they saw(empty); that is the grid's existing empty-value string, chosen over minting a new key per the dispatch.@object-ui/fields' privateresolveLookupRecordNameperforms the same operation by callinggetRecordDisplayNameand string-matching the floor; it could callreferencedRecordTitleinstead. Outside this claim's file surface.Verification
Ablation, one leg per producer plus the empty label (scripts/ablation-replace.mjs, restore proven blob == HEAD each time; vitest resolves the ui packages from src)
referencedRecordTitle(targetDef, rec, ...)replaced by the olddisplayField ?? name ?? label ?? titleread: 2 failed (the nameField pin and the zh-CN pin, which also reads the deal numbers); thedisplayFieldCONTROL stayed green.lookupTargetDefs?.get(meta.target)replaced byundefined: 3 failed (nameField, same-title, zh-CN); CONTROL green.targetDefreplaced byundefined: 2 failed (options, chip); CONTROL green.t('grid.empty')replaced by'(empty)': 6 failed (every heading list that includes the empty group); the picker file green.Local runs at head 2e944be
@object-ui/core,@object-ui/plugin-grid,@object-ui/componentswhole packages (pnpm --dir ui exec vitest run packages/core/ packages/plugin-grid/ packages/components/): Test Files 1017 passed, 1 skipped; Tests 11601 passed, 51 skipped; lock VERDICT command-exit 0.type-checkfor the same three packages: exit 0.pnpm --dir ui exec vitest run scripts/: 171 files passed, 2 skipped; exit 0.dispatch-gates --commandsderived 38 families; all 38 run with exit 0;--ranreconciliation: 38 accounted, 0 NOT-MEASURED (derived zero).uicheck:new-line-citations: 0 new citations.overlap-check: clean against origin/main b1eb500, 0 PR heads.test:repo, the lint farm,Lint UI,Test UIshards, dogfood (no!, no narrowing arm).Generated by Claude Code